Function.prototype.myApply = function (context) {
  context = context || window;

  const fn = Symbol();
  context[fn] = this;

  const result;
  if (arguments[1]) {
    result = context[fn](...arguments[1]);
  } else {
    result = context[fn]();
  }
  delete context[fn];
  
  return result;
};
